package com.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.entity.OrderMessage;
import com.example.mapper.OrderMapper;
import com.example.service.OrderMessageSrvice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderMessageServiceImpl extends ServiceImpl<OrderMapper, OrderMessage> implements OrderMessageSrvice {
    @Autowired
    private OrderMapper orderMapper;

    public List<OrderMessage> selectList(OrderMessage orderMessage) {
        QueryWrapper<OrderMessage> qwr = new QueryWrapper<>();
        qwr.select().orderByDesc("create_time");
        qwr.like("openid", orderMessage.getOpenid());
        List<OrderMessage> list = orderMapper.selectList(qwr);
        return list;
    }

}

